package com.stormrage.entity.edu.rep;

import java.io.Serializable;

import com.stormrage.entity.edu.EduCourse;

public class EduCourseRep implements Serializable {

	// ------------------------------- Fields -------------------------------

	private static final long serialVersionUID = 377940059754982336L;

	// ------------------------------- Fields -------------------------------

	private Integer seq;

	private Integer id;

	private Integer viewId;

	private String course;

	private String lec;

	private Integer chap;

	private String chapStr;

	private Integer count;

	// ------------------------------- Fields -------------------------------

	public EduCourseRep() {
	}

	// ------------------------------- Fields -------------------------------

	public Integer getSeq() {
		return seq;
	}

	public void setSeq(Integer seq) {
		this.seq = seq;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Integer getViewId() {
		return viewId;
	}

	public void setViewId(Integer viewId) {
		this.viewId = viewId;
	}

	public String getCourse() {
		return course;
	}

	public void setCourse(String course) {
		this.course = course;
	}

	public String getLec() {
		return lec;
	}

	public void setLec(String lec) {
		this.lec = lec;
	}

	public Integer getChap() {
		return chap;
	}

	public void setChap(Integer chap) {
		this.chap = chap;
	}

	public String getChapStr() {
		return chapStr;
	}

	public void setChapStr(String chapStr) {
		this.chapStr = chapStr;
	}

	public Integer getCount() {
		return count;
	}

	public void setCount(Integer count) {
		this.count = count;
	}

	// ------------------------------- Fields -------------------------------

	public static EduCourseRep instance(EduCourse arg0, Integer arg1, Integer arg2, String lec) {
		EduCourseRep entity = new EduCourseRep();
		entity.setSeq(arg1);
		entity.setId(arg0.getId());
		entity.setCourse(arg0.getCourse());
		entity.setChap(arg0.getChap());
		if (entity.getChap().equals(0))
			entity.setChapStr("唯一");
		if (entity.getChap().equals(1))
			entity.setChapStr("不唯一");
		entity.setLec(lec);
		entity.setCount(arg2);
		return entity;
	}

	public static EduCourseRep instance(EduCourseRep arg0, Integer arg1, Integer arg2) {
		arg0.setSeq(arg1);
		arg0.setCount(arg2);
		if (arg0.getChap().equals(0))
			arg0.setChapStr("唯一");
		if (arg0.getChap().equals(1))
			arg0.setChapStr("不唯一");
		return arg0;
	}

	public static String initChapStr(Integer arg0) {
		String str = null;
		if (arg0.equals(0))
			str = "唯一";
		if (arg0.equals(1))
			str = "不唯一";
		return str;
	}

	@Override
	public String toString() {
		return this.getClass() + " : id - " + id + " viewId - " + viewId + " course - " + course + " lec - " + lec
				+ " count - " + count;
	}

}
